/**
 * TODO: 临时写的页面异常组件，待 830 AT 的 Placeholder 组件实现后进行替换
 */

import React from 'react';
import PropTypes from 'prop-types';
import './index.scss';

export default class MessagePage extends React.Component {
  static propTypes = {
    pictureUrl: PropTypes.string,
    title: PropTypes.string,
    desc: PropTypes.string,
  };

  static defaultProps = {
    pictureUrl: '',
    title: '',
    desc: '',
  };

  render() {
    const { pictureUrl, title, desc } = this.props;
    const prefix = 'message-page';

    return (
      <div className={prefix}>
        <img className={`${prefix}-img`} src={pictureUrl} alt={title} />
        {title ? <div className={`${prefix}-title`}>{title}</div> : null}
        {desc ? <div className={`${prefix}-desc`}>{desc}</div> : null}
      </div>
    );
  }
}
